#include "StateResult.h"

CStateResult::CStateResult() : m_eTypeResult(Processing), m_vTransitions(NULL)
{	
}

//-------------------------------------------------------------------------
CStateResult::TypeResult CStateResult::GetResult() 
{ 
	return m_eTypeResult; 
}

//-------------------------------------------------------------------------
void CStateResult::SetResult(TypeResult result)
{
	m_eTypeResult = result;
}

//-------------------------------------------------------------------------
void CStateResult::SetTransitions(TTransitionList &vTransitions)
{
	m_vTransitions = vTransitions;
}

//-------------------------------------------------------------------------
void CStateResult::AddTransition(const CTransitionPtr &pTransition)
{
	m_vTransitions.push_back(pTransition);
}

//-------------------------------------------------------------------------
const CTransitionPtr &CStateResult::GetTransition(u32_t idx)
{
	return m_vTransitions[idx];
}

//-------------------------------------------------------------------------
u32_t CStateResult::GetNumTransitions()
{
	return m_vTransitions.size();
}

//-------------------------------------------------------------------------
const CActionPtr &CStateResult::GetAction(u32_t idx)
{
	return m_vActions[idx];
}

//-------------------------------------------------------------------------
u32_t CStateResult::GetNumActions()
{
	return m_vActions.size();
}

//-------------------------------------------------------------------------
void CStateResult::AddActions(TActionList &vActions)
{
	for(TActionList::iterator it = vActions.begin(); it != vActions.end(); ++it)
	{
		AddAction(*it);
	}
}

//-------------------------------------------------------------------------
void CStateResult::AddAction(CActionPtr &pAction)
{
	m_vActions.push_back(pAction);
}

//-------------------------------------------------------------------------
void CStateResult::Clear()
{
	m_vActions.clear();
	m_eTypeResult = Processing;
	m_vTransitions.clear();
}

DEFINE_RTTI_CLASS( CStateResult, CFSMObject );